/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package vue;

import media.Media;
import media.Video;
import java.util.ArrayList;


/**
 *
 * @author Florian Minin & Khémon Beh
 */
public class TableModeleVideo extends TableModele {

    public TableModeleVideo(){
        this.nomsColonnes = new String[]{"", "Nom", "Emplacement", "Description","Titre", "Auteur(s)", "Annee de sortie","Note"};
    }

    public TableModeleVideo(ArrayList<Media> tab){
        this.nomsColonnes = new String[]{"", "Nom", "Emplacement", "Description","Titre", "Auteur(s)", "Annee de sortie","Note"};
        donnees = tab;
    }

    public Object getValueAt(int row, int col) {
            Video video = (Video) donnees.get(row);
            if (col == 0) return row+1;
            if (col == 1) return video.getNomFichier();
            if (col == 2) return video.getCheminSurDisque();
            if (col == 3) return video.getDescription();
            if (col == 4) return video.getTitre();
            if (col == 5) return video.afficherAuteurs();
            if (col == 6) return video.getAnnee();
            else return video.getNote();
    }

    public void setNomsColonnes(String[] nomsColonnes) {
        this.nomsColonnes = new String[]{"", "Nom", "Emplacement", "Description","Titre", "Auteur(s)", "Annee de sortie","Note"};
    }

}
